DECLARE @Table TABLE (ID INT PRIMARY KEY IDENTITY(1,1), A BIT, B BIT)

INSERT  INTO @Table (A,B) 
VALUES  (0,0),
	   (1,0),
	   (0,1),
	   (1,1)

SELECT  A,B,
	   (A ^ B) AS ExclusiveOr,
	   A | B AS OrResult,
	   A & B AS AndResult
FROM	   @Table




























--DECLARE @Table2 TABLE (ID INT PRIMARY KEY IDENTITY(1,1), Test INT)

--INSERT INTO @Table2 (Test) VALUES (123456),(122944)

--SELECT CAST(Test AS BINARY), Test FROM @Table2
--SELECT CAST(Test AS BINARY), CAST(512 AS BINARY) FROM @Table2 WHERE (Test & 512) <> 0








--, 
	   --A ^ B AS ExclusiveORResult
	   
	   
	   
	   
	   --, 
